package cn.cutie.clot.fs;

import org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

import java.io.File;

@SpringBootApplication
@Import(RocketMQAutoConfiguration.class)
public class ClotFsApplication {

    public static void main(String[] args) {
        SpringApplication.run(ClotFsApplication.class, args);
    }

    // 1.基于文件的分布式文件系统：目前实现
    // 2.块存储：最常见，效率最高；可以改造为块存储
    // 3.对象存储

    @Value("${clotfs.path}")
    private String uploadPath;

    @Bean
    ApplicationRunner runner() {
        return args -> {
            FileUtils.init(uploadPath);

            System.out.println("ClotFsApplication started");
        };
    }
}
